<template>
	<view class="coupon">
		<view class="header">
			<!-- 满减 -->
			<view class="left">
				<view class="minus">
					<view class="unit">
						￥
					</view>
					<view class="number">
						{{query.face}}
					</view>
				</view>
				<view class="full">
					{{query.threshold_str}}
				</view>
			</view>
			<!-- 虚线 -->
			<view class="height-dotted-line">
			</view>
			<!-- 名称 -->
			<view class="right">
				<view class="name-of-shop">
					<view class="title">
						{{query.title}}
					</view>
					<view class="time">
						<text class="color1">剩余</text>
						<text class="color2">{{query.yu}}</text>
						<text class="color1">丨共{{query.quantity}}张</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 虚线 -->
		<view class="width-dotted-line">
		</view>
		<view class="bottom">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			query: {
				type: Object,
				default: {},
				required: true
			},
		},
		data() {
			return {

			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.coupon {
		width: 702rpx;
		height: 256rpx;
		background: #ffffff;
		border-radius: 16rpx;
		margin-bottom: 20rpx;

		.header {
			width: 100%;
			height: 158rpx;
			display: flex;
			flex-direction: row;
			align-items: center;

			.left {
				width: 185rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				padding-left: 32rpx;

				.minus {
					display: flex;
					flex-direction: row;
					align-items: baseline;
					margin-bottom: 2rpx;

					.unit {
						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						text-align: left;
						color: #f37364;
					}

					.number {
						font-size: 56rpx;
						font-family: DIN, DIN-Bold;
						font-weight: 700;
						text-align: left;
						color: #f37364;
					}
				}

				.full {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: center;
					color: #666666;
				}
			}

			.height-dotted-line {
				width: 0rpx;
				height: 118rpx;
				opacity: 0.1;
				border: 1rpx dashed #333333;
				margin: 0 33rpx;
			}

			.right {
				flex: 1;
				padding-right: 32rpx;
				display: flex;
				flex-direction: row;
				align-items: center;

				.name-of-shop {
					display: flex;
					flex-direction: column;
					flex: 1;

					.title {
						font-size: 32rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						text-align: left;
						color: #333333;
						margin-bottom: 8rpx;
					}

					.time {
						font-size: 20rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						text-align: left;

						.color1 {
							color: #666666;
						}

						.color2 {
							color: #73F0EA;
						}
					}
				}
			}
		}

		.width-dotted-line {
			opacity: 0.1;
			border: 1rpx dashed #333333;
		}

		.bottom	 {
			width: 100%;
			height: 98rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			padding: 0 24rpx;

			.btn {
				transform: rotateZ(360deg);
				width: 152rpx;
				height: 64rpx;
				border: 1rpx solid #73F0EA;
				border-radius: 16rpx;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: center;
				color: #73F0EA;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
	}
</style>